<template>
    <div>
        <MyToast ref="myWarn" />
        <img class="warn" src="@/assets/images/warn.png" alt="" @click="handlerWarnOpen">
        <div class="searchWrapper">
            <router-link to="/search">
                <input type="text" placeholder="请输入搜索内容" />
                <img src="@/assets/images/shop/search.png" class="searchIcon" />
            </router-link>
        </div>
        <router-link to="/points/detail?id=97">
            <img src="@/assets/images/turntable/aaa.jpg" alt />
        </router-link>
        <div class="icon">
            <div class="item" @click="jump(item)" v-for="(item,index) in leftlist" :key="index">
                <img :src="imgBaseUrl+item.picUrl" alt />
                <p>{{item.categoryName}}</p>
            </div>
        </div>
        <!--  优惠券轮播 -->
        <div class="couponList" v-if="couponLIst.length>0">
            <div class="head-wrapper">
                <span class="get_center">
                    <span class="coupon_icon"></span>
                    积分兑权益
                </span>
                <router-link tag="span" class="more" to="/points-exp?code=2">权益规则</router-link>
            </div>
            <div class="van_swipe_item">
                <div :class="['swipe_item', items.coin<=30?'coupon_bg1':items.coin<=50?'coupon_bg2':items.coin<=100?'coupon_bg3':items.coin<=300?'coupon_bg4':'coupon_bg5']" v-for="(items,indexs) in couponLIst" :key="indexs" @click="getCoupon(items)">
                    <div class="item">
                        <div class="coupon_info">
                            <span class="num">
                                <span style="font-size:22px">¥</span>
                                {{items.discountValue}}
                            </span>
                            <span>剩余数量：{{items.stock}}</span>
                        </div>
                        <div class="toGet">
                            <span style="color:red;">{{items.coin}}积分兑换</span>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <!-- 热门活动产品推荐 -->
        <div v-if="hotList.length>0" class="product_hot">
            <div class="head-wrapper">
                <span class="get_center">
                    <span class="icon"></span>
                    热门推荐
                </span>
                <router-link tag="span" class="more" to="/points">查看更多</router-link>
            </div>
            <ul class="gift-ul">
                <router-link class="gift-item" tag="li" :to="{path: item.buyLimit === 0 ? '/error':'/points/detail', query:{ id: item.id}}" v-for="item in hotList" :key="item.id">
                    <div class="gift-pic">
                        <img v-lazy="imgBaseUrl+item.ico" alt class="pic" />
                    </div>
                    <div class="info">
                        <h2 class="name">{{item.subTitle}}</h2>
                        <div class="subTitle" v-if="item.skuList.length>0">
                            <span v-for="(items,indexs) in item.skuList" :key="indexs">{{items}}</span>
                        </div>
                    </div>
                    <button class="exchange-btn" :class="{'no-stock':item.limitNum===0}">{{item.limitNum !==0 ? '立即购买' : '敬请期待'}}</button>
                </router-link>
            </ul>
        </div>
        <Tabbar />
    </div>
</template>

<script>
import Vue from 'vue';
import { Button, Dialog } from 'vant';
import { imgBaseUrl, baseUrl } from '@/config/env';
import weixin from '@/components/wx/wx.js';
import Tabbar from '@/components/tabbar';
import MyToast from "../homeClass/MyToast";
// import moment from 'moment';
Vue.use(Dialog);
export default {
    data() {
        return {
            timeout: '',
            newlist: [],
            timer: { d: '0', h: '', m: '', s: '' },
            seckilltime: '',
            seckilltab: 0,
            imgBaseUrl,
            animate: false,
            coinRule: require('@/assets/images/coin_rule.png'),
            coinDetail: require('@/assets/images/coinDetail1.png'),
            orderDetail: require('@/assets/images/order_circuit.png'),
            data: {},
            currentNum: '', // 当前积分
            userInfo: null,
            isAuth: null,
            couponLIst: [],
            hotList: [],
            actList: [],
            orderlsit: [],
            CouponNumList: [],
            showToa: true,
            leftlist: []
        };
    },
    mounted() {
        if (window.sessionStorage.getItem('toast') === 'key') {
            console.log(window.sessionStorage.getItem('toast'));
            this.showToa = false;
        }
        this.currentUserInfo();
        this.getCouponList();
        this.getSourceList();
        this.getHotProductList();
        // this.initWxChat();
        this.getActlist();
        this.getOrderList();
        this.getCouponNum();
        this.getleftcalss();
    },
    methods: {
        handlerWarnOpen() {
            console.log(this.$refs.myWarn);
            this.$refs.myWarn.isShow = true;
        },
        // 跳转产品详情页
        jumpProductDetail(type, id, stock) {
            this.$router.push({
                path: '/seckillDetail',
                query: {
                    id: id,
                    stock: stock
                }
            });
            // if (type === '距活动结束还有') {
            //   this.$router.push({
            //     path: '/seckillDetail',
            //     query: {
            //       id: id,
            //       stock: stock
            //     }
            //   });
            // }
            // if (type === '距活动开始还有') {
            //   Toast('即将秒杀，敬请期待哦~');
            // }
            // if (type === '本周秒杀已结束') {
            //   Toast('对不起，秒杀已结束，下回再来哦~');
            // }
        },
        clicktab(type) {
            setTimeout(() => {
                clearInterval(this.timeout);
            }, 100);
            // this.timeout = '';
            this.seckilltab = type;
            this.newlist = [];
            this.seckilltime = '';
            this.timer.d = '0';
            this.timer.h = '';
            this.timer.m = '';
            this.timer.s = '';
            this.getSourceList();
        },
        // 获取当天活动场次列表
        getSourceList() {
            this.$http
                .post('/seckill/list', { type: this.seckilltab === 0 ? '1' : '2' })
                .then(res => {
                    console.log(res);
                    if (res && res.data.object) {
                        res.data.object.map((n, index) => {
                            this.newlist = n.seckillList;
                            console.log(this.newlist);
                            this.timeout = setInterval(() => {
                                const nowTime = new Date().getTime();
                                if (nowTime < n.seckillStart) {
                                    // this.seckillData.typeTop.push('即将开始');
                                    // this.seckillData.typeLeft[index] = '距开始';
                                    this.seckilltime = '距活动开始还有';

                                    const time = (n.seckillStart - nowTime) / 1000; // 获取天、时、分、秒

                                    const d = parseInt(time / (60 * 60 * 24));
                                    const h = parseInt((time % (60 * 60 * 24)) / 3600);
                                    const m = parseInt(((time % (60 * 60 * 24)) % 3600) / 60);
                                    const s = parseInt(((time % (60 * 60 * 24)) % 3600) % 60);
                                    this.timer.d = d;
                                    this.timer.h = h;
                                    this.timer.m = m;
                                    this.timer.s = s;
                                    console.log(h);
                                } else if (
                                    nowTime >= n.seckillStart &&
                                    nowTime < n.seckillEnd
                                ) {
                                    // this.seckillData.typeTop.push('正在秒杀');
                                    // this.seckillData.typeLeft[index] = '距结束';
                                    this.seckilltime = '距活动结束还有';
                                    const time = (n.seckillEnd - nowTime) / 1000; // 获取天、时、分、秒
                                    const d = parseInt(time / (60 * 60 * 24));
                                    const h = parseInt((time % (60 * 60 * 24)) / 3600);
                                    const m = parseInt(((time % (60 * 60 * 24)) % 3600) / 60);
                                    const s = parseInt(((time % (60 * 60 * 24)) % 3600) % 60);
                                    this.timer.d = d;
                                    this.timer.h = h;
                                    this.timer.m = m;
                                    this.timer.s = s;
                                } else if (nowTime >= n.seckillEnd) {
                                    // this.seckillData.typeTop.push('秒杀结束');
                                    this.seckilltime = '本周秒杀已结束';
                                }
                            }, 1000);
                        });
                        console.log('秒杀', this.seckillData);
                    }
                });
        },
        initWxChat() {
            const url = window.location.href.split('#')[0];
            const param = {
                title: '邮储银行厦门分行积分兑换活动',
                desc: '限量满减权益大放送，领券下单更优惠！',
                link:
                    baseUrl + 'entrance/goto?redir=' + window.location.href.split('#')[1],
                imgUrl:
                    'http://img.580travel.com/ticket/b9ed3290-db74-11e9-a515-c13cae82320b',
                localUrl: url
            };
            weixin.wxChat(this, param);
        },
        getleftcalss() {
            this.$http.post('/product/category').then(res => {
                console.log(res);
                if (res) {
                    this.leftlist = res.data.slice(0, 10);
                }
            });
        },
        // 获取单张优惠券
        jump(item) {
            this.$router.push({
                path: '/points',
                query: { cid: item.id }
            });
        },
        getCoupon(item) {
            if (this.isAuth === '0') {
                Dialog.confirm({
                    title: '提示',
                    message: '您还未实名认证',
                    cancelButtonText: '再看看',
                    confirmButtonText: '去认证'
                })
                    .then(() => {
                        this.$router.replace('/real_name');
                    })
                    .catch(() => { });
            } else {
                console.log(item);
                Dialog.confirm({
                    confirmButtonColor: '#28b46a',
                    confirmButtonText: '领取',
                    // title: '提示',
                    message: '该权益满' + item.faceValue + '可用,您确定领取该权益吗?'
                })
                    .then(() => {
                        // if (moment().isBefore('2019-12-21')) {
                        this.$http
                            .post('/tuserCoupon/add', { couponId: item.id.toString() })
                            .then(res => {
                                console.log(res);
                                if (res.data.code === '0') {
                                    Dialog.confirm({
                                        confirmButtonColor: '#28b46a',
                                        confirmButtonText: '查看规则',
                                        title: '提示',
                                        message: '您成功领取该权益,可在我的权益中查看'
                                    })
                                        .then(() => {
                                            this.currentUserInfo();
                                            this.getCouponList();
                                            this.$router.push('/points-exp?code=2');
                                        })
                                        .catch(() => {
                                            this.currentUserInfo();
                                            this.getCouponList();
                                        });
                                } else {
                                    Dialog.confirm({
                                        confirmButtonColor: '#28b46a',
                                        title: '提示',
                                        message: res.data.message
                                    })
                                        .then(() => {
                                            this.currentUserInfo();
                                            this.getCouponList();
                                        })
                                        .catch(() => {
                                            this.currentUserInfo();
                                            this.getCouponList();
                                        });
                                }
                            });
                        // } else {
                        //   Dialog.alert({
                        //     confirmButtonColor: '#28b46a',
                        //     title: '提示',
                        //     message:
                        //       '邮储积分兑换活动已于2019年12月20日结束，已兑换产品请于2019年12月31日前核销，来不及核销的产品请自行保存好卡号卡密等关键信息，本活动链接将于2019年12月31日后开始升级，升级后所有记录清零！'
                        //   }).then(() => {
                        //     this.currentUserInfo();
                        //     this.getCouponList();
                        //   });
                        // }
                    })
                    .catch(() => { });
            }
        },
        // 获取用户信息
        currentUserInfo() {
            this.$http.post('/tuser/userInfo', {}).then(res => {
                if (res) {
                    if (res.data.code === '0') {
                        this.userInfo = res.data.object;
                        this.currentNum = res.data.object.coinAmount;
                        this.isAuth = res.data.object.isAuth;
                        console.log(this.isAuth);
                    }
                }
            });
        },
        getCouponList() {
            this.$http.post('/coupon/list', { pageSize: 1000 }).then(res => {
                if (res.data.list.length > 0) {
                    this.couponLIst = res.data.list;
                }
            });
        },
        getHotProductList() {
            this.$http.post('/product/hotList').then(res => {
                this.hotList = res.data.object;
            });
        },
        toAuth() {
            this.$router.push('/real_name');
        },
        toProduct(item) {
            if (this.isAuth === '0') {
                Dialog.confirm({
                    title: '提示',
                    message: '您还未实名认证',
                    cancelButtonText: '再看看',
                    confirmButtonText: '去认证'
                })
                    .then(() => {
                        this.$router.replace('/real_name');
                    })
                    .catch(() => { });
            } else {
                this.$router.push({
                    path: item.buyLimit === 0 ? '/error' : '/points/detail',
                    query: { id: item.id }
                });
            }
        },
        getActlist() {
            this.$http.post('/activity/list').then(res => {
                console.log(res);
                this.actList = res.data.list;
            });
        },
        toActlist(items) {
            this.$router.push('/' + items.url);
        },
        getOrderList() {
            this.$http.post('/order/list', {}).then(res => {
                // console.log(res.data.list.length);
                this.orderlsit = res.data.list;
            });
        },
        getCouponNum() {
            this.$http.post('/tuserCoupon/list', {}).then(res => {
                console.log(res);
                this.CouponNumList = res.data.list;
            });
        },
        toActivity() {
            this.$router.push('/turntableCoin');
            window.sessionStorage.setItem('toast', 'key');
        },
        activityImg() {
            this.showToa = false;
            window.sessionStorage.setItem('toast', 'key');
        }
    },
    components: {
        'van-button': Button,
        Tabbar,MyToast
    }
};
</script>

<style lang="scss" scoped>
.warn {
  width: 110px;
  height: 110px;
  position: fixed;
  z-index: 111;
  right: 32px;
  bottom: 168px;
}
.pinkwarn {
  width: 100%;
  font-size: 26px;
  letter-spacing: 1px;
  color: #1c4237;
  margin: 30px auto;
  text-align: center;
}
.acttime {
  display: flex;
  padding-right: 20px;
  .green {
    width: 32px;
    height: 32px;
    background-color: #1c4237;
    border-radius: 0.07rem;
    text-align: center;
    font-size: 0.33rem;
    color: #fdfcfb;
  }
}
.seckilltime {
  width: 700px;
  height: 90px;
  background-image: url(../../assets/images/seckill/seckilltime.png);
  background-size: 100%;
  background-repeat: no-repeat;
  margin: 30px auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  color: #1c4237;
  p {
    padding-right: 80px;
  }
}
.tabs {
  width: 700px;
  height: 62px;
  background-image: url(../../assets/images/seckill/nowweek.png);
  background-size: 100%;
  background-repeat: no-repeat;
  margin: 20px auto;
  display: flex;
  justify-content: space-around;
  align-items: center;
  font-size: 30px;
  p {
    width: 50%;
    height: 100%;
    text-align: center;
    line-height: 62px;
  }
}
.tabs1 {
  width: 700px;
  height: 62px;
  background-image: url(../../assets/images/seckill/nextweek.png);
  background-size: 100%;
  background-repeat: no-repeat;
  margin: 20px auto;
  display: flex;
  justify-content: space-around;
  align-items: center;
  font-size: 30px;
  p {
    width: 50%;
    height: 100%;
    text-align: center;
    line-height: 62px;
  }
}
.content {
  width: 690px;
  display: flex;
  // padding: 0.43rem 0.47rem;
  padding: 20px;
  // padding-bottom: 0;
  margin: 0.4rem auto;
  background-color: #1c4237;
  border-radius: 15px;
  position: relative;
  img {
    height: 3.13rem;
    border-radius: 0.11rem;
  }
  .center {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    justify-content: flex-start;
    margin-left: 0.2rem;
    // padding: 20px;
    .title {
      width: 420px;
      color: #ffffff;
      font-weight: 700;
      margin-bottom: 0.1rem;
      // overflow: hidden;
      // text-overflow: ellipsis;
      // white-space: nowrap;
      font-size: 26px;
      word-wrap: break-word;
    }
    .subtitle {
      width: 420px;
      color: #ffffff;
      margin-bottom: 0.1rem;
      // overflow: hidden;
      // text-overflow: ellipsis;
      // white-space: nowrap;
      font-size: 22px;
      word-wrap: break-word;
    }
    .botWrapper {
      // display: flex;
      // align-items: flex-end;
      // justify-content: space-between;
      width: 100%;
      .bot {
        .rest {
          width: 1.56rem;
          height: 0.59rem;
          border-radius: 0.11rem;
          border: solid 0.04rem #ff0000;
          text-align: center;
          font-size: 0.32rem;
          color: #ff0000;
          margin-bottom: 0.3rem;
        }
        .coin {
          line-height: 0.4rem;
          color: #ffd19b;
          margin-bottom: 0.2rem;
          font-size: 26px;
          .spanimg {
            background-image: url(../../assets/images/seckill/zbtb.png);
            background-size: 100%;
            background-repeat: no-repeat;
            display: inline-block;
            width: 81px;
            height: 26px;
          }
        }
        .price {
          color: #ffffff;
          text-decoration: line-through;
        }
      }
    }
  }
  .btn {
    width: 2rem;
    height: 0.91rem;
    border-radius: 0.11rem;
    border: none;
    // margin-top: 2rem;
    font-size: 26px;
    color: #ffd19b;
    border: solid 1px #ffd19b;
    background-color: #1c4237;
    position: absolute;
    // bottom: 15px;
    right: 10px;
    bottom: 80px;
    padding: 0;
  }
  // .btnG {
  //   background-color: #c3c3c3;
  // }
  // .btnR {
  //   background-color: #fa0000;
  // }
}
.product_hot1 {
  padding-bottom: 10px;
  position: relative;
  background-color: #ffffff;
  .hot_img {
    position: fixed;
    top: 800px;
    left: 20px;
    display: flex;
    flex-direction: column;
    z-index: 10;
    img {
      width: 130px;
      margin-top: 20px;
    }
  }
}
.header-wrapper {
  position: relative;
  height: 300px;
  // background-image: linear-gradient(163deg, #26a1f1 40%, #4388ef 100%);
  background-image: url('../../assets/images/bg.png');
  background-size: 100% 100%;
  display: flex;
  flex-direction: column;
  // align-items: center;
  .signin-tag {
    width: 162px;
    background-color: #ffc400;
    border-radius: 25px 0 0 25px;
    @include sc(26px, #454545);
    position: absolute;
    right: 0;
    top: 20px;
    text-align: center;
    line-height: 50px;
    cursor: pointer;
    text-indent: 12px;
  }
  .left {
    width: 700px;
    height: 141px;
    margin-left: 38px;
    margin-top: 20px;
    display: flex;
    // justify-content: space-around;
    // align-items: center;
    flex-direction: row;
    .logo {
      float: left;
      width: 80px;
      height: 80px;
      margin-right: 30px;
      img {
        width: 141px;
        display: block;
        border-radius: 50%;
      }
    }
    .headerFont {
      width: 370px;
      align-items: center;
      @include sc(26px, #fff);
      .name {
        display: flex;
        flex-direction: row;
        align-items: center;
        margin-top: 15px;
        .p2 {
          width: 165px;
          font-size: 22px;
          padding: 6px 7px;
          border: 1px solid #fff;
          border-radius: 8px;
          text-align: center;
          margin-left: 20px;
        }
      }
      .total {
        width: 100%;

        @include sc(26px, #fff);
        margin-top: 30px;
      }
      .coin_num {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        margin-top: 55px;
        margin-left: -450px;
        .coin_icon {
          display: block;
          width: 40px;
          height: 40px;
          margin-right: 10px;
          background-image: url(../../assets/images/star.png);
          background-size: 100% 100%;
          font-size: 30px;
        }
        p {
          font-size: 30px;
        }
      }
    }
  }
  .right {
    position: absolute;
    right: 0px;
    top: 50px;
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: space-between;
    .coindet {
      width: 150px;
      height: 45px;
      background-color: #feed62;
      color: red;
      line-height: 49px;
      text-align: center;
      border-radius: 25px;
    }
    a {
      display: block;
      margin: 10px 0;
      img {
        width: 163px;
      }
    }
  }
}
.myMessage {
  width: 710px;
  height: 199px;
  background-color: #ffffff;
  border-radius: 10px;
  position: absolute;
  top: 360px;
  align-self: center;
}
.myList {
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  margin-top: 42px;
  .line {
    width: 1px;
    height: 30px;
    background-color: #fff;
  }
  .list_item {
    width: 249px;
    text-align: center;
    :first-child {
      font-size: 40px;
      color: #fff;
    }
    :nth-child(2) {
      font-size: 24px;
      color: #fff;
    }
  }
}
.integral-wrapper {
  height: 150px;
  background-color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  .left {
    display: flex;
    min-width: 248px;
    align-items: center;
    flex-direction: column;
    // background-image: url(../../assets/images/more-arrows.png);
    background-repeat: no-repeat;
    background-position: right center;
    background-size: 20px;
    .number {
      color: #000000;
      font-size: 38px;
    }
    .txt {
      color: #989898;
      font-size: 28px;
    }
  }
  .right {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 341px;
    height: 70px;
  }
  .signBtn {
    width: 160px;
    height: 70px;
    line-height: 70px;
    text-align: center;
    font-size: 26px;
    background-color: #3889ff;
    border-radius: 8px;
    border: none;
    color: #ffffff;
  }
  .integral {
    width: 160px;
    height: 70px;
    background-color: white;
    border: 1px solid #3889ff;
    border-radius: 8px;
    color: #3889ff;
    font-size: 26px;
    text-align: center;
    line-height: 70px;
  }
}
.head-cell {
  height: 75px;
  background-color: #ffffff;
  padding: 0 25px;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #ebebeb;
  .title {
    color: #454545;
    font-size: 30px;
    .icon {
      width: 31px;
      height: 32px;
      display: inline-block;
      @include bis('../../assets/images/customer_service.png');
      vertical-align: sub;
      margin-right: 15px;
    }
  }
  .right {
    display: flex;
    align-items: center;
    a {
      color: #454545;
      font-size: 30px;
      float: left;
    }
    img {
      margin-left: 5px;
      height: 25px;
      color: #ccc;
    }
  }
}
.menu-wrapper {
  width: 750px;
  height: 199px;
  border-radius: 10px;
  background-color: #ffffff;
  display: flex;
  // margin-left: 20px;
  align-items: center;
  flex-direction: row;
  flex-wrap: wrap;
  // margin-bottom: 30px;
  // position: absolute;
  // top: 350px;
  justify-content: space-around;
  .item {
    width: 20%;
    // min-width: 187.5px;
    height: 167px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    position: relative;
    .hot {
      width: 50px;
      position: absolute;
      top: 0;
      right: 10px;
    }
    img {
      height: 53px;
      margin-bottom: 20px;
    }
    .icon {
      width: 82px;
      height: 82px;
      background-size: 100% 100%;
      background-repeat: no-repeat;
      margin-bottom: 20px;
      &.act {
        background-image: url(../../assets/images/act.png);
      }
      &.my_order {
        background-image: url(../../assets/images/my_order.png);
      }
      &.coupon {
        background-image: url(../../assets/images/coupon.png);
      }
      &.hot_new {
        background-image: url(../../assets/images/hot_new.png);
      }
      &.get_order {
        background-image: url(../../assets/images/home/linc.png);
      }
      &.gift_mail {
        background-image: url(../../assets/images/gift_mail.png);
      }
    }
    p {
      color: #454545;
      font-size: 26px;
    }
  }
}
.cover {
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  padding-left: 18px;
  padding-right: 17px;
  .middleBox {
    width: 10rem;
    margin: 0 auto;
    height: 586px;
    .signImg {
      width: 100%;
      height: 280px;
      .ImgSize {
        height: 306px;
      }
    }
    .signFooter {
      width: 511px;
      height: 300px;
      margin: 0 auto;
      background-color: #ffffff;
      border-radius: 30px;
      display: flex;
      align-items: center;
      flex-direction: column;
      .signFooterOne {
        width: 318px;
        height: 42px;
        color: #020202;
        font-size: 34px;
        letter-spacing: 2px;
        margin-top: 71px;
      }
      .signFooterTwo {
        width: 450px;
        height: 88px;
        background-color: #3889ff;
        border-radius: 8px;
        color: #ffffff;
        font-size: 32px;
        border: none;
        margin-top: 71px;
      }
    }
  }
}
.secret-popup {
  padding: 20px;
  p {
    padding: 20px;
  }
}
.info-wrapper {
  width: 690px;
  box-shadow: 0px 1px 10px 0px rgba(181, 184, 185, 0.75);
  border-radius: 20px;
  height: 120px;
  background-color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 36px;
  margin: -20px auto 20px;
  position: relative;
  z-index: 2;
  .left {
    display: flex;
    align-items: center;
    .info {
      border-right: 1px solid #ebebeb;
      padding-right: 30px;
      margin-right: 30px;
    }
    .num {
      font-size: 24px;
      color: #626262;
    }
    .exp {
      @include sc(28px, #626262);
    }
  }
  .right {
    height: 60px;
    text-align: center;
    line-height: 60px;
    background-image: linear-gradient(270deg, #4388ef 0%, #26a1f1 100%);
    border-radius: 8px;
    font-size: 28px;
    color: #fff;
    padding: 0 12px;
  }
}
.member {
  font-size: 28px;
  color: #454545;
  margin-bottom: 16px;
  .member-icon {
    width: 46px;
    height: 46px;
    margin-right: 5px;
    display: inline-block;
    vertical-align: bottom;
    background-image: url('../../assets/images/vip_icon.png');
    background-repeat: no-repeat;
    background-size: 313px;
    &.vip1 {
      background-position: 0 -50px;
    }
    &.vip2 {
      background-position: -90px -50px;
    }
    &.vip3 {
      background-position: -172px -50px;
    }
    &.vip4 {
      background-position: -252px -50px;
    }
  }
}
.featured-wrapper {
  display: flex;
  background-color: #fff;
  justify-content: center;
  margin-bottom: 30px;
  .item {
    min-width: 333px;
    height: 260px;
    position: relative;
    display: flex;
    padding: 20px 25px;
    flex-direction: row;
    border-right: 1px solid #ebebeb;
    display: flex;
    flex: 1;
    &:last-child {
      border-right: none;
    }
    .icon {
      margin-right: 11px;
      height: 33px;
      vertical-align: text-top;
    }
    .name {
      font-size: 30px;
      color: #363636;
    }
    .desc {
      font-size: 24px;
      color: #9b9b9b;
    }
    .left-goods {
      position: absolute;
      bottom: 20px;
      left: 20px;
      .pic {
        width: 151px;
        height: 80px;
      }
      .name {
        font-size: 20px;
        color: #9b9b9b;
        width: 151px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        margin-top: 15px;
      }
    }
    .right-goods {
      width: 144px;
      height: 144px;
      position: absolute;
      right: 25px;
      bottom: 20px;
    }
  }
}

.coin-push {
  height: 75px;
  background-color: #ffffff;
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 0 30px;
  border-bottom: 1px solid #ebebeb;
  .title {
    font-size: 30px;
    color: #454545;
    margin-right: 50px;
  }
}
.scroll-wrap {
  width: 350px;
  height: 60px;
  display: flex;
  flex: 1;
  overflow: hidden;
  .icon {
    line-height: 1;
    display: inline-block;
    padding: 6px 8px;
    border-radius: 5px;
    color: #fff;
    background-color: #f30008;
  }
  .scroll-content {
    height: 60px;
    overflow: hidden;
    li {
      font-size: 26px;
      text-align: center;
      line-height: 60px;
      a {
        color: #4d4d4d;
      }
    }
    &.marquee_top {
      transition: all 0.4s;
      margin-top: -55px;
    }
  }
}
.goods-wrapper {
  background-color: #fff;
  margin-bottom: 30px;
  .head {
    height: 75px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 2px solid #f2f2f2;
    .title-icon {
      height: 42px;
    }
  }
}

.coin-wrapper {
  width: 100%;
  overflow: hidden;
}
.coin-list {
  margin-top: 20px;

  .gift-item {
    display: inline-block;
    width: 232px;
    // height: 413px;
    background-color: #ffffff;
    box-shadow: 0 0 10px #cecece;
    position: relative;
    margin-bottom: 20px;
    margin-left: 22px;
    &:last-child {
      border-bottom: none;
    }
    .gift-pic {
      height: 227px;
      display: flex;
      align-items: center;
      justify-content: center;
      .pic {
        width: 100%;
        height: 100%;
      }
    }
    .info {
      padding: 0 10px;
      .name {
        font-size: 19px;
        color: #000000;
        font-weight: 400;
        min-height: 58px;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        word-break: break-all;
        margin: 15px 0 0;
      }
      .num {
        color: #ff010d;
        font-size: 18px;
        display: flex;
        align-items: center;
        .limit {
          height: 20px;
          margin-right: 10px;
        }
        span {
          font-size: 18px;
        }
      }
      p {
        font-size: 16px;
        color: #8b8a8a;
      }
      del {
        font-size: 16px;
        color: #8b8a8a;
        display: block;
        height: 25px;
      }
    }
    .exchange-btn {
      position: absolute;
      right: 10px;
      bottom: 15px;
      background-color: #fff;
      color: #3889ff;
      border: 1px solid #3889ff;
      border-radius: 8px;
      font-size: 18px;
      display: inline-block;
      &.no-stock {
        color: #fff;
        border: 1px solid #b7b6b7;
        background-color: #b7b6b7;
      }
    }
  }
}
.mask {
  position: fixed;
  height: 100%;
  width: 100%;
  top: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 99;
}
.confirm-popup {
  text-align: center;
  padding: 30px;
  width: 528px;
  position: relative;
  top: 50%;
  left: 50%;
  -webkit-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
  border-radius: 20px;
  padding-bottom: 100px;
  padding-top: 181px;
  background-image: url('http://img.580travel.com/image/bocm/workerprize/back.png');
  background-size: 100%;
  background-repeat: no-repeat;
  margin-left: -10px;
  p {
    font-size: 44px;
    color: #030303;
    text-align: center;
    text-indent: 50px;
  }
  .btn {
    width: 330px;
    height: 80px;
    background-color: #3889ff;
    border-radius: 40px;
    font-size: 36px;
    color: #ffffff;
    border: none;
    margin-top: 368px;
    margin-left: 30px;
  }
  .close-icon {
    width: 50px;
    height: 50px;
    background-image: url('http://img.580travel.com/image/bocm/workerprize/closeico.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    display: inline-block;
    position: absolute;
    right: -20px;
    top: -60px;
    cursor: pointer;
  }
}
.rule-tips {
  @include bis('../../assets/images/rule_tips.png');
  width: 127px;
  height: 127px;
  position: fixed;
  right: 20px;
  bottom: 120px;
  z-index: 3;
  // animation: fit 1.2s ease-in-out 0.5s infinite alternate;
}
@keyframes fit {
  from {
    transform: translate(0, 0);
  }
  to {
    transform: translate(5px, 70px);
  }
}
.gift-ul {
  background-color: #ffffff;
  display: flex;
  flex-wrap: wrap;
  .gift-item {
    display: flex;
    width: 100%;
    background-color: #ffffff;
    border-bottom: 1px solid #ebebeb;
    position: relative;
    padding: 36px 30px;
    &:last-child {
      border-bottom: none;
    }
    .gift-pic {
      height: 210px;
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      .pic {
        height: 100%;
        width: 100%;
      }
    }
    .info {
      padding: 0 20px;
      .name {
        @include sc(28px, #000);
        line-height: 38px;
        font-weight: 400;
        padding-bottom: 16px;
        max-height: 75px;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        word-break: break-all;
        margin: 6px 0 0;
        width: 446px;
      }
      .sku {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        p {
          display: flex;
          align-items: center;
          justify-content: center;
          // width: 72px;
          // height: 35px;
          border-radius: 3px;
          border: solid 1px #fc0208;
          font-size: 18px;
          color: #fc0208;
          line-height: 30px;
          text-align: center;
          margin-left: 10px;
          margin-top: 10px;
        }
      }
      .num {
        @include sc(28px, #ff010d);
        display: flex;
        align-items: center;
        .limit {
          height: 32px;
          margin-left: 10px;
        }
        span {
          font-size: 28px;
        }
      }
      p {
        @include sc(24px, #8b8a8a);
      }
      del {
        @include sc(24px, #8b8a8a);
        display: block;
        height: 30px;
      }
    }
    .exchange-btn {
      position: absolute;
      right: 10px;
      bottom: 16px;
      width: 180px;
      height: 55px;
      line-height: 50px;
      background-color: #28b46a;
      border: 1px solid #28b46a;
      border-radius: 8px;
      @include sc(22px, #fff);
      &.no-stock {
        color: #fff;
        background-color: #fff;
        border: 1px solid #b7b6b7;
        background-color: #b7b6b7;
      }
    }
  }
}
.product_hot {
  padding-bottom: 140px;
  margin-top: 30px;
  position: relative;
  .hot_img {
    position: fixed;
    top: 800px;
    left: 20px;
    display: flex;
    flex-direction: column;
    z-index: 10;
    img {
      width: 130px;
      margin-top: 20px;
    }
  }
}

.head-wrapper {
  height: 75px;
  background-color: #fff;
  padding: 0 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  @include sc(30px, #454545);
  border-bottom: 2px solid #ebebeb;
  .get_center {
    font-size: 30px;
    color: #454545;
    // margin-right: 50px;
    // font-weight: bold;
  }
  .icon {
    width: 32px;
    height: 32px;
    display: inline-block;
    @include bis('../../assets/images/recommend.png');
    vertical-align: sub;
    margin-right: 15px;
  }
  .icon1 {
    width: 32px;
    height: 32px;
    display: inline-block;
    @include bis('../../assets/images/seckill/miaosha.png');
    vertical-align: sub;
    margin-right: 15px;
  }
  .coupon_icon {
    width: 45px;
    height: 35px;
    display: inline-block;
    @include bis('../../assets/images/coupon.png');
    vertical-align: sub;
    // margin-right: 15px;
  }
  .coupon_icon_one {
    width: 45px;
    height: 35px;
    display: inline-block;
    @include bis('../../assets/images/my_order.png');
    vertical-align: sub;
    // margin-right: 15px;
  }
  .more {
    color: #28b46a;
    background-image: url('../../assets/images/more-arrows.png');
    background-repeat: no-repeat;
    background-size: 13px;
    padding-right: 25px;
    background-position: center right;
  }
}
.couponList {
  margin-bottom: 30px;
  background-color: white;
  height: 444px;
  margin-top: 30px;
  .van_swipe_item {
    height: 369px;
    background-color: white;
    white-space: nowrap;
    overflow: scroll;
    // padding: 18px 0 18px 0;
    .swipe_item_img {
      width: 460px;
      background-size: 100% 100%;
      overflow: hidden;
      margin: 0 0 0 15px;
      display: inline-block;
      margin-top: 30px;
      .item {
        margin-top: 20px;
        :first-child {
          font-size: 24px;
        }
        :nth-child(2) {
          font-size: 20px;
          padding-top: 10px;
          color: #424242;
        }
      }
    }
    .swipe_item {
      width: 210px;
      height: 305px;
      background-size: 100% 100%;
      overflow: hidden;
      margin: 0 0 0 5px;
      display: inline-block;
      margin-top: 30px;
      .coupon_info {
        height: 222px;
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        color: white;
        margin-top: 10px;
        span {
          font-size: 20px;
        }
        .num {
          font-size: 74px;
          // margin-top: 51px;
          line-height: 55px;
          margin-bottom: 16px;
        }
        .condition {
          font-size: 22px;
          margin-bottom: 10px;
        }
        .coupon_type {
          height: 25px;
          line-height: 25px;
        }
      }
      .toGet {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        margin-top: 10px;
        span {
          color: #28b46f;
          font-size: 26px;
        }
        p {
          color: #959595;
          font-size: 20px;
        }
      }
    }
    .coupon_bg1 {
      background-image: url(../../assets/images/coupon_bg_blue.png);
    }
    .coupon_bg2 {
      background-image: url(../../assets/images/coupon_bg_orange.png);
    }
    .coupon_bg3 {
      background-image: url(../../assets/images/coupon_bg_green.png);
    }
    .coupon_bg4 {
      background-image: url(../../assets/images/coupon_bg_pink.png);
    }
    .coupon_bg5 {
      background-image: url(../../assets/images/coupon_bg_purpose.png);
    }
  }
}
.act_toast {
  position: fixed;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  .toast_item {
    width: 100%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    .toast_img {
      width: 100%;
    }
  }
}
footer {
  text-align: center;
  padding: 20px;
  color: #a5a5a5;
}
.icon {
  width: 100%;
  height: 300px;
  display: flex;
  flex-direction: row;
  // justify-content: space-around;
  flex-wrap: wrap;
  background-color: #ffffff;
  align-items: center;
  .item {
    position: relative;
    width: 150px;
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    .hot {
      width: 50px;
      position: absolute;
      top: 0;
      right: 10px;
    }
    img {
      width: 61px;
    }
    p {
      font-size: 24px;
      color: #616161;
      margin-top: 5px;
    }
  }
}
.bottom_item {
  margin-top: 30px;
  width: 750px;
  height: 440px;
  background-color: #ffffff;
  .botttom_title {
    display: flex;
    flex-direction: row;
    padding-left: 30px;
    padding-top: 30px;
    img {
      width: 50px;
    }
    p {
      font-size: 30px;
      letter-spacing: 1px;
      color: #303030;
      padding-left: 20px;
    }
  }
  .card {
    width: 100%;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-around;
    align-items: center;
    img {
      width: 334px;
      margin-top: 30px;
    }
  }
}
.hot_img {
  position: fixed;
  top: 600px;
  right: 20px;
  display: flex;
  flex-direction: column;
  z-index: 10;
  img {
    width: 130px;
    margin-top: 20px;
  }
}
.searchWrapper {
  width: 100%;
  height: 1.6rem;
  background-color: #ffffff;
  border-bottom: 1px solid #eeeeee;
  input {
    width: 9.21rem;
    height: 0.87rem;
    background-color: #f1f1f1;
    border-radius: 0.39rem;
    border: none;
    position: absolute;
    top: 0.37rem;
    left: 0.4rem;
    text-align: center;
    font-size: 0.35rem;
  }
  .searchIcon {
    width: 0.51rem;
    height: 0.52rem;
    position: absolute;
    top: 0.57rem;
    right: 0.8rem;
  }
}
.subTitle {
  padding: 0.1rem 0;
  span {
    // display: inline-block;
    padding: 0.066667rem;
    color: red;
    line-height: 0.54rem;
    border: 1px solid red;
    border-radius: 0.066667rem;
    margin: 0.066667rem;
    font-size: 0.24rem;
  }
}
</style>
